<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<div id="comments">
    <?php $this->comments()->to($comments); ?>
    <h3>评论（ <?php $this->commentsNum(); ?> ）</h3>
    <?php if($this->allow('comment')): ?>
        <?php if($this->user->hasLogin()): ?>
            <div id="<?php $this->respondId(); ?>" class="respond">
                <form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
                    <div class="comment">
                        <div class="comment-box">
                                <textarea placeholder="您的评论或留言（必填）"
                                    name="text" id="comment-textarea" cols="100%" rows="3" tabindex="3"></textarea>
                            <div class="comment-ctrl">
                                <div class="cancel-comment-reply">
                                    <?php $comments->cancelReply('取消'); ?>
                                </div>
                                <button type="submit" name="comment-submit" id="comment-submit" tabindex="4">评论</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        <?php else: ?>
            <h4>请登录后评论</h4>
        <?php endif; ?>
    <?php else: ?>
        <h3><?php _e('评论已关闭'); ?></h3>
    <?php endif; ?>
    <?php if ($comments->have()): ?>
        <?php $comments->listComments(); ?>

        <?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>

    <?php endif; ?>
</div>
